import React from 'react';
import { connect } from 'react-redux';
import actions from '../store/actions/saga';

class User extends React.Component {
    static async getInitialProps(props) {
        const { store, isServer } = props.ctx;
        console.log('初始化数据');
        console.log(store.getState().placeholderData);
        if (!store.getState().placeholderData) {
            store.dispatch(actions.loadUserData());
        }
        return { isServer };
    }

    render() {
        console.log(this.props);
        return <div>33</div>;
    }
}

export default connect(state => state)(User);
